package com.zhongkai.controller;

import com.zhongkai.app.service.SendDateOrUnlikeService;
import com.zhongkai.model.utils.ZhongkaiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

//派单记录列表 异常记录列表

@Controller
public class SendDateOrUnlikeController {

    @Autowired
    private SendDateOrUnlikeService sendDateOrUnlikeService;


    /**
     * 派单记录列表
     *
     * @param page 当前页数
     * @param rows 每页数据条数
     */

    @RequestMapping(value = "/send_dou/list_date", produces = "application/json;charset=utf-8")
    @ResponseBody
    public ZhongkaiResult sendDateList(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer rows) {

        ZhongkaiResult result = sendDateOrUnlikeService.sendDateList(page, rows);

        return result;
    }


    /**
     * 异常记录列表
     *
     * @param page 当前页数
     * @param rows 每页数据条数
     */

    @RequestMapping(value = "/send_dou/list_unlike", produces = "application/json;charset=utf-8")
    @ResponseBody
    public ZhongkaiResult unlikeList(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer rows) {

        ZhongkaiResult result = sendDateOrUnlikeService.unlikeList(page, rows);

        return result;
    }


    /**
     * 派单记录列表查询
     *
     * @param name 维修人员姓名
     * @param page 页数
     * @param rows 每页数据数量
     * @param time 选择的时间
     */

    @RequestMapping(value = "/send_dou/list_seek", produces = "application/json;charset=utf-8")
    @ResponseBody
    public ZhongkaiResult seekList(String name, @RequestParam(defaultValue = "0") Integer page,
                                   @RequestParam(defaultValue = "0") Integer rows,
                                   @RequestParam(defaultValue = "0") Long time
                                   ) {

        ZhongkaiResult result = sendDateOrUnlikeService.seekList(name, page, rows,time);

        return result;
    }


    /**
     * 异常记录列表查询
     *
     * @param name 用户姓名
     * @param page 页数
     * @param rows 每页数据数量
     * @param time 时间
     */
    @RequestMapping(value = "/send_dou/list_ke", produces = "application/json;charset=utf-8")
    @ResponseBody
    public ZhongkaiResult unitKe(String name, @RequestParam(defaultValue = "0") Integer page,
                                   @RequestParam(defaultValue = "0") Integer rows,
                                   @RequestParam(defaultValue = "0") Long time
    ) {

        ZhongkaiResult result = sendDateOrUnlikeService.unitKe(name, page, rows,time);

        return result;
    }
}
